package com.guigu.yh.springcloud.service;

import com.guigu.yh.springcloud.common.JsonResult;
import com.guigu.yh.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 假装付款服务
 *
 * @author 张颖辉（zyh）
 * @version 1.0.0
 * @date 2022/08/21
 */
@Component
//服务消费者标识 feign 客户端的@FeignClient注解，配置服务提供者的服务名称
@FeignClient("CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {
    @GetMapping("payment/get/{id}")
    public JsonResult<Payment> getPayment(@PathVariable("id") Long id);


    @RequestMapping("payment/testFeignTimeOut")
    public String testFeignTimeOut();
}
